<div style="background-color: rgb(232, 232, 232); text-align: left;" vlink="#0099cc" alink="#0099cc" link="#0099cc" bgcolor="#e8e8e8">

<center>

<table cellspacing="0" cellpadding="0" border="0" width="700">
  <tbody><tr>
    <td style="padding-top: 20px; padding-bottom: 20px; text-align: left;">
      <center>
        <table cellspacing="0" cellpadding="0" border="0" width="650">
          <tbody><tr>
            <td style="padding: 0 20px 20px 20px; font-family: Helvetica,sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); text-align: left;">

              <h1 style="font-family: Helvetica,sans-serif; font-size: 28px; color: rgb(51, 51, 51); margin-bottom: 0pt; font-weight: bold;">Your Daily Tender Digest for <a target="blank" href="<%= @site.href(:html)%>"><%= @name %></a></h1>

              <h2 style="margin: 6px 0pt 0pt; font-family: Helvetica,sans-serif; font-size: 16px; color: rgb(119, 119, 119); font-weight: normal;">
                Discussions marked as pending
              </h2>
            </td>
          </tr>

          <tr>
            <td style="border-top: 1px solid rgb(204, 204, 204); padding: 20px; font-family: Helvetica,sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); text-align: left;">
              <p style="color: rgb(204, 51, 51); font-weight: bold; font-size: 16px; margin-bottom: 10px; padding-bottom: 0pt;">Pending discussions:</p>

              <table>
                <tbody><tr>
                  <td style="padding-left: 20px;">

                    <%- @discussions.reverse.each do |discussion| -%>
                      <p style="font-weight: normal; font-size: 14px; color: #000; margin-bottom: 2px; padding-bottom: 0pt;">
                        <span style="margin:0 3px; padding:2px 7px 3px 7px; font-size:10px; font-weight:normal; background:#eee; color:#666; text-transform:uppercase; -webkit-border-radius:3px; -moz-border-radius:2px; white-space:nowrap;">
                        <%= discussion['state'] %>
                        </span>

                        <%- if discussion['last_updated_at'] < 1.day.ago -%>
                        <a target="_blank" style="color: rgb(204, 51, 51);" href="<%= discussion.href(:html) %>">
                        <%- else -%>
                         <a target="_blank" href="<%= discussion.href(:html) %>">
                         <%- end -%>

                           <% if discussion['unread'] %><strong><% end %>
                           <%= discussion["title"] %>
                           <% if discussion['unread'] %></strong><% end %>
                         </a>
                      </p>
                      <table>
                          <tbody><tr>
                            <td style="vertical-align: top; padding-right: 3px;"><span style="font-size: 24px; line-height: 18px;">•</span></td>
                            <td style="font-size: 14px; vertical-align: top; padding-bottom: 3px;">
                              From <%= discussion['last_author_name']%> &lt;<%= discussion['last_author_email'] %>&gt;

                              <p style="margin: 0pt; font-weight: normal; color: rgb(119, 119, 119); font-size: 12px;">

                                  Last updated
                                  <strong><%= discussion['last_updated_at'].localtime.to_s(:short) %></strong>
                                   —
                                <%- if discussion['public'] -%>
                                <strong>Discussion is public</strong>
                                <%- else -%>
                                Discussion is private
                                <%- end -%>
                              </p>
                            </td>
                          </tr>

                      </tbody></table>
                    <%- end -%>

                  </td>
                </tr>
              </tbody></table>

            </td>
          </tr>

<!--
          <tr>
            <td style="border-top: 1px solid rgb(204, 204, 204); padding: 20px 20px 30px; font-family: Helvetica,sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); text-align: left;">
              <p><a target="_blank" style="font-size: 12px; color: rgb(102, 102, 102);" href="#">Unsubscribe to stop receiving updates</a></p>
            </td>
          </tr>
        </tbody></table>
-->

        <table cellspacing="0" cellpadding="0" border="0" width="650">
          <tbody><tr>
            <td style="padding-top: 10px; padding-bottom: 30px; font-size: 10px; font-family: Verdana,sans-serif; color: rgb(102, 102, 102); text-align: left;">

            </td>
          </tr>
        </tbody></table>

      </center>
    </td>
  </tr>
</tbody></table>

</center>

</div>